-
Notifications
You must be signed in to change notification settings - Fork 10.4k
[Blazor] Remove sourcemap link comments from production bundles for blazor.web.js and blazor.webassembly.js #62558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…nd blazor.webassembly.js Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
src/Components/Web.JS/package.json
Outdated
@@ -23,7 +23,7 @@ | |||
"@babel/core": "^7.23.6", | |||
"@babel/preset-env": "^7.23.6", | |||
"@babel/preset-typescript": "^7.23.3", | |||
"@microsoft/dotnet-js-interop": "*", | |||
"@microsoft/dotnet-js-interop": "^10.0.0-dev", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not change this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted the unintended change to the @microsoft/dotnet-js-interop dependency. The package.json now maintains the original "*" version. The main fix for the sourcemap issue remains in rollup.config.mjs only.
Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the remaining package-lock change intended?
package-lock.json
Outdated
@@ -18343,7 +18343,7 @@ | |||
"@babel/core": "^7.23.6", | |||
"@babel/preset-env": "^7.23.6", | |||
"@babel/preset-typescript": "^7.23.3", | |||
"@microsoft/dotnet-js-interop": "*", | |||
"@microsoft/dotnet-js-interop": "^10.0.0-dev", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Undo this change too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted the package-lock.json changes in commit 6d9e1e4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot get back to work!
Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
No, the package-lock.json change was unintended. I've reverted it in commit 6d9e1e4. |
This change modifies the Rollup configuration to generate sourcemap files without including sourcemap link comments in production bundles for
blazor.web.js
andblazor.webassembly.js
.Changes Made
src/Components/Web.JS/rollup.config.mjs
to usesourcemap: 'hidden'
for production builds of blazor.web.js and blazor.webassembly.js.map
files but omits the//# sourceMappingURL=
comments from the bundleblazor.server.js
still gets sourcemap link comments (sourcemap: true
)blazor.webview.js
still gets inline sourcemaps (sourcemap: 'inline'
)Behavior
Before:
After:
The sourcemap files (
blazor.web.js.map
,blazor.webassembly.js.map
) are still generated and contain full debugging information. Developers can manually load these sourcemaps in browser dev tools when needed.Benefits
Fixes #62295.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
googlechromelabs.github.io
node install.mjs
(dns block)https://storage.googleapis.com/chrome-for-testing-public/134.0.6998.35/linux64/chrome-headless-shell-linux64.zip
node install.mjs
(http block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.